﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using System.Globalization;

namespace TriviaViews.Converters
{

    [ValueConversion(typeof(bool), typeof(string))]

    public class BoolToStringConverter : IValueConverter
    {
        /// <summary>
        /// converts from bool to string object, sets the content after the user choses an answer indicates if its true or false
        /// </summary>
        /// <param name="value"></param>
        /// <param name="targetType"></param>
        /// <param name="parameter"></param>
        /// <param name="culture"></param>
        /// <returns></returns>
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if ((bool)value)
            {
                return "Well Done";
            }
            else if (!(bool)value)
                return "Wrong Answer";
            else
                return "";
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
